package com.qst.control;

import com.qst.service.UserInfoManagerService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/updateUserInfo")
public class UpdateUserInfoServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//       获取前端传递过来的参数
        String userlogname=req.getParameter("userlogname");
        String userrelname=req.getParameter("userrelname");
        String userpwd=req.getParameter("userpwd");
        String useremail=req.getParameter("useremail");
        Integer userrole=Integer.parseInt(req.getParameter("userrole"));
        Integer userstatus=Integer.parseInt(req.getParameter("userstatus"));
//        创建逻辑层
        UserInfoManagerService service=new UserInfoManagerService();
        service.updateUserInfo(userlogname,userpwd,userrelname,useremail,userrole,userstatus);
        req.getRequestDispatcher("/getUserInfoes").forward(req,resp);
    }
}
